package p.sunmes.les.actor;

import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.ParticleEmitter;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.scenes.scene2d.Actor;

public class ParticleActor extends Actor {

	ParticleEmitter pe;

	public ParticleActor(ParticleEmitter pe) {
		this.pe = pe;
		setSize(12, 12);
	}

	public void start() {
		pe.start();
	}

	public void reset() {
		pe.reset();
	}

	public ParticleEmitter getParticleEffect() {
		return pe;
	}

	Vector2 pos = new Vector2();

	@Override
	public void act(float delta) {
		super.act(delta);
		pe.setPosition(getX(), getY());
		pe.update(delta);
	}

	@Override
	public void draw(Batch batch, float parentAlpha) {
		pe.draw(batch);
	}

}
